package BLC

import (
	"bytes"
	"encoding/binary"
	"encoding/json"
	"fmt"
	"log"
)

// int64 转成 字节数组
func IntToHex(num int64) []byte {
	buff := new(bytes.Buffer)
	err := binary.Write(buff,binary.BigEndian,num)
	if err != nil{
		log.Panic(err)
	}
	return buff.Bytes()

}


func JSONToArray(jsonString string)  []string {

	fmt.Println(jsonString)
	// json 转成 []string
	var sArr []string
	if err := json.Unmarshal([]byte(jsonString), &sArr) ; err != nil{
		log.Panic(err)
	}
	return sArr
}

